package cz.proks.schoolpupilbook.gwt.widget.common;

import com.google.gwt.resources.client.CssResource.ImportedWithPrefix;
import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.resources.client.ImageResource.ImageOptions;
import com.google.gwt.resources.client.ImageResource.RepeatStyle;
import com.google.gwt.user.cellview.client.CellBrowser;
import com.google.gwt.user.client.ui.SplitLayoutPanel;
import com.google.gwt.view.client.TreeViewModel;

public class PupilCellBrowser extends CellBrowser {

	public <T> PupilCellBrowser(TreeViewModel viewModel, T rootValue,
			Resources resources) {
		super(viewModel, rootValue, resources);
		// TODO Auto-generated constructor stub
	}

	public <T> PupilCellBrowser(TreeViewModel viewModel, T rootValue) {
		super(viewModel, rootValue);
		// TODO Auto-generated constructor stub
	}
	
	SplitLayoutPanel getDisplayPanel() {
		return (SplitLayoutPanel) getWidget();
	}
	
	public interface Resources extends CellBrowser.Resources {
		/**
	     * An image indicating a closed branch.
	     */
		@Source("com/google/gwt/user/cellview/client/cellBrowserClosed.gif")
	    @ImageOptions(flipRtl = true)
	    ImageResource cellBrowserClosed();

	    /**
	     * An image indicating an open branch.
	     */
		@Source("com/google/gwt/user/cellview/client/cellBrowserOpen.gif")
	    @ImageOptions(flipRtl = true)
	    ImageResource cellBrowserOpen();

	    /**
	     * The background used for open items.
	     */
	    // Use RepeatStyle.BOTH to ensure that we do not bundle the image.
		@Source("com/google/gwt/user/cellview/client/cellBrowserOpenBackground.png")
	    @ImageOptions(repeatStyle = RepeatStyle.Both, flipRtl = true)
	    ImageResource cellBrowserOpenBackground();

	    /**
	     * The background used for selected items.
	     */
	    // Use RepeatStyle.BOTH to ensure that we do not bundle the image.
	    @Source("com/google/gwt/user/cellview/client/cellTreeSelectedBackground.png")
	    @ImageOptions(repeatStyle = RepeatStyle.Both, flipRtl = true)
	    ImageResource cellBrowserSelectedBackground();

	    /**
	     * The styles used in this widget.
	     */
	    @Source(Style.DEFAULT_CSS)
	    Style cellBrowserStyle();
	}
	
	/**
	   * Styles used by this widget.
	   */
	  @ImportedWithPrefix("pupilCellBrowser")
	  public interface Style extends CellBrowser.Style {
	    /**
	     * The path to the default CSS styles used by this resource.
	     */
	    String DEFAULT_CSS = "PupilCellBrowser.css";

	    /**
	     * Applied to all columns.
	     */
	    String cellBrowserColumn();

	    /**
	     * Applied to even list items.
	     */
	    String cellBrowserEvenItem();

	    /**
	     * Applied to the first column.
	     */
	    String cellBrowserFirstColumn();

	    /***
	     * Applied to keyboard selected items.
	     */
	    String cellBrowserKeyboardSelectedItem();

	    /**
	     * Applied to odd list items.
	     */
	    String cellBrowserOddItem();

	    /***
	     * Applied to open items.
	     */
	    String cellBrowserOpenItem();

	    /***
	     * Applied to selected items.
	     */
	    String cellBrowserSelectedItem();

	    /**
	     * Applied to the widget.
	     */
	    String cellBrowserWidget();
	  }
}
